<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <script>
    //例
    function add(...values) {
      let sum = 0;
      sum = values.reduce(function (sum, value) {
        return sum += value;
      })
      return sum;
    }
    add(2, 5, 3, 1, 5) // 16

    //例
    function fun(a, b, ...values) {
      console.log(a); //1
      console.log(b); //2
      console.log(values); //[3, 4, 5, 6]
    }
    fun(1, 2, 3, 4, 5, 6);
  </script>
</body>

</html>